﻿<Page x:Class="QKitSampleApp.LinearDial.RotatePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:QKitSampleApp.LinearDial"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:q="using:QKit"
      mc:Ignorable="d"
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- TitlePanel -->
        <StackPanel Margin="19,12,0,25">
            <TextBlock Text="ROTATE IMAGE"
                       Style="{ThemeResource TitleTextBlockStyle}"
                       Typography.Capitals="SmallCaps" />
        </StackPanel>

        <!--TODO: Content should be placed within the following grid-->
        <Grid Grid.Row="1"
              x:Name="ContentRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Image Source="/Assets/Dog.jpg"
                   RenderTransformOrigin="0.5,0.5"
                   Margin="38">
                <Image.RenderTransform>
                    <CompositeTransform Rotation="{Binding ElementName=AngleDial, Path=Value}" />
                </Image.RenderTransform>
            </Image>
            <q:LinearDial x:Name="AngleDial"
                          Grid.Row="1"
                          Maximum="360"
                          LargeChange="15"
                          MarkerInterval="15"
                          IsLoopingEnabled="True" />
        </Grid>
    </Grid>
</Page>
